// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import '@babel/polyfill'
import App from './App'
import router from './router'
import axios from 'axios'
import VueAxios from 'vue-axios'
import laydate from 'laydate'
import VueAwesomeSwiper from 'vue-awesome-swiper'
import layer from 'vue-layer'
import VueContextMenu from 'vue-contextmenu'
import 'vue-contextmenu/style/css/font-awesome.min.css'
import contentmenu from 'v-contextmenu'
import 'v-contextmenu/dist/index.css'
import qs from 'qs'
import {postRequest} from './utils/api'
Vue.prototype.postRequest = postRequest;
Vue.prototype.$qs = qs
Vue.prototype.$http = axios
Vue.use(laydate)
Vue.use(contentmenu)
Vue.use(VueContextMenu)
axios.defaults.baseURL = 'http://localhost:8082'
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'
Vue.use(VueAxios, axios)
Vue.use(VueAwesomeSwiper)
Vue.use(VueContextMenu)
Vue.prototype.$layer = layer(Vue)
Vue.config.productionTip = false
/*
const session=window.sessionStorage
*/
/* var axiosinstance = axios.create({
  // config里面有这个transformRquest，这个选项会在发送参数前进行处理。
 // #这时候我们通过Qs.stringify转换为表单查询参数
      transformRequest: [function (data) {
          data = qs.stringify(data);
          return data;
      }],
 // #设置Content-Type
      headers:{'Content-Type':'application/x-www-form-urlencoded'}
  })
  Vue.use(VueAxios, axiosinstance)
   */
/*
var size:1000;
*/
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: {App},
  template: '<App/>'
})
